﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using ADO;

namespace Service.Login
{
    public class InfoManager : LogIn
    {
        //---------------
        override public bool EnterInterface()
        {
            return true;
        }
        //----------
        override public void Initialize(String t_name, String t_password)
        {
            name = t_name;
            password = t_password;
        }
        //--------------------------
        override public bool IsLegal()
        {
            String sqlstr = "";
            //DataSet DataTable;
            string psw;
            if (name == "" || password == "")
                return false;
            sqlstr = "select Psw from Staff where name='" + name + "' and Department='信息管理'";
            DataBaseAccess DAO = new DataBaseAccess();
            psw = DAO.GetScalar(sqlstr);
            if (psw != null)
                if (psw.Equals(password))
                {
                    return true;
                }
            return false;
        }
        //---------------------------------------
        override public bool Record()
        {
            return true;
        }
        //-----------------------------------------
        private String name;
        private String password;
    }
}
